package day8homework;

import java.util.Scanner;

public class Ceshi02 {
	public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
	System.out.println("请输入数组的长度:");
	int a = scanner.nextInt();
	int[] array = new int[a];
	int max;
	for(int i = 0; i < array.length ;i++) {
		System.out.println("请输入数组元素");
		int num = scanner.nextInt();
		array[i] = num;
	}
	for(int i = 0;i < array.length;i++){
		System.out.print(array[i] + " ");
	}
	System.out.println();
	for(int i = 1; i < array.length/2; i++) {
		int front = 0;
		int rear = array.length - 1;
		int temp;
		temp = array[front];
		array[front] = array[rear];
		array[rear] = temp;
//		front += 1;
//		rear -= 1;
	}
	for(int i = 0; i < array.length; i++) {
		System.out.print(array[i] + " ");
	}
 }
}